﻿var exhibit;


$(document).ready(function () {
    zTreeObj = $("#treeDemo").zTree(setting, zNodes);
    exhibit = document.getElementById("iframe1");
});

function getRootPath() {
    var strFullPath = window.document.location.href;
    var strPath = window.document.location.pathname;
    var pos = strFullPath.indexOf(strPath);
    var prePath = strFullPath.substring(0, pos);
    var postPath = strPath.substring(0, strPath.substr(1).indexOf('/') + 1);
    return (prePath + postPath);
}


var zTreeObj;
var setting = {
    showLine: true,
    showIcon:false,
    nameCol: "ename", //不写，默认name  
    isSimpleData: true,
    rootPID: -1,
    treeNodeKey: "id",
    treeNodeParentKey: "pId"
};

var zNodes = [
   { "id": 1, "pId": 0, "ename": "会员管理"},
   { "id": 11, "pId": 1, "ename": "会员操作", "click": "changExhibit('member/MemberOperation.aspx')" },
   { "id": 12, "pId": 1, "ename": "等级操作", "click": "changExhibit('level/LevelOperation.aspx')" },
   { "id": 2, "pId": 0, "ename": "消费项目管理"},
   { "id": 21, "pId": 2, "ename": "消费项目列表", "click": "changExhibit('spend/SpendList.aspx')" },
   { "id": 22, "pId": 2, "ename": "项目类型操作", "click": "changExhibit('spend/SpendTypeOperation.aspx')" },
   { "id": 3, "pId": 0, "ename": "结算管理"},
   { "id": 31, "pId": 3, "ename": "结算记录", "click": "changExhibit('bill/BillList.aspx')" },
   { "id": 32, "pId": 3, "ename": "新建结算", "click": "changExhibit('bill/AddNewBill.aspx')" }
];

function changExhibit(path) {
    exhibit.src = path;
}